<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<jsp:include page="/public/public.jsp"/> 
<script language="javascript" type="text/javascript" src="../script/DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript">
function checkIP(value){
  var pattern = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}$/;
  if (!pattern.exec(value)) {
    alert('please input valid ip address');
    return false;
  }
  var ary = value.split('.');
  for(key in ary)
  {
    if (parseInt(ary[key]) > 255){
      alert('please input valid ip address');
      return false;
    }
  }
  return true;
}
</script>
</head>
<body>

<jsp:include page="/public/head.jsp"/>  
    <div class="wrapper clearfix">
    <jsp:include page="/public/left.jsp"/>  
	<div class="main">
<s:form name="usr" action="usrSaveAction!save.action" namespace="/usr">
<table class="advert-tab" cellspacing="0">
<tr class="advert-th">
		<th colspan="6" >
			<s:if test="#request.oper==save">
			添加用户基本信息
			</s:if>
			<s:else>
			修改用户基本信息
			</s:else>
		</th>
	</tr>
	<tr>
		<td>用户名</td>
		<td><input type="text" name="username" value="${username }"/></td>
		<td>组织机构代码</td>
		<td><input type="text" name="corporateCode" value="${corporateCode }"/></td>
		<td>地址</td>
		<td><input type="text" name="address" value="${address }"/></td>
	</tr>
	<tr>
		<td>电话号码</td>
		<td><input type="text" name="phone" value="${phone }"/></td>
		<td>传真号码</td>
		<td><input type="text" name="fax" value="${fax }"/></td>
		<td>电子邮件</td>
		<td><input type="text" name="email" value="${email }"/></td>
	</tr>
	<tr>
		<td>用户描述</td>
		<td><input type="text" name="description" value="${description }"/></td>
		<td>身份证号</td>
		<td><input type="text" name="idCard" value="${idCard }"/></td>
		<td>注册IP</td>
		<td><input type="text" name="registerIp" value="${registerIp }" onchange="checkIP(this.value);"/></td>
	</tr>
	<tr>
		<td>注册时间</td>
		<td><input type="text" name="registerDate" value="${registerDate }" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/></td>
		<td>警号</td>
		<td><input type="text" name="userPoliceNo" value="${userPoliceNo }"/></td>
	</tr>
		<tr>
		<td>所属角色</td>
		<td>
		 

			<select name="roleId">
			<s:set value="#request.roleId" name="curRoleId"/> 
					<s:iterator  value="#request.rlist" id="role" status="rolelist">
				
					<option
						<s:if test="#request.oper=='update'&& #curRoleId==#role.roleId">
							selected
					</s:if>
					 value="<s:property value="#role.roleId" />"><s:property value="#role.roleName" />
					 </option>
						
					</s:iterator>
			</select>
		</td>
	</tr>
	<tr>
	<td colspan=6>
		<input type="submit" value="保存"/><input type="reset" value="重置"/>
		<input type="reset" value="返回" onclick="location.href='/OpenAuthWebApplication/usr/usr_list.jsp'"/>
		<input type="hidden" value="${userId }" name="userId"/>&nbsp;
		<input type="hidden" value="${oper }" name="oper"/>
	</td>
	</tr>
</table>
</s:form>
</div>
</div>
<%@ include file="/public/footer.jsp"%>
</body>
</html>